//package com.cb.compass;
//
//import java.util.Date;
//
//
//import org.compass.core.Compass;
//import org.compass.core.CompassHit;
//import org.compass.core.CompassHits;
//import org.compass.core.CompassSession;
//import org.compass.core.CompassTransaction;
//import org.compass.core.support.search.CompassSearchCommand;
//import org.compass.core.support.search.CompassSearchHelper;
//import org.compass.core.support.search.CompassSearchResults;
//import org.compass.gps.CompassGps;
//
//import com.cb.core.test.BaseManagerTestCase;
//import com.cb.model.sample.Article;
//import com.cb.model.sample.Category;
//import com.cb.sample.service.ArticleManager;
//import com.cb.sample.service.CategoryManager;
//
//
//public class CompassServiceTestCase extends BaseManagerTestCase{
//	private Compass compass;
//	private ArticleManager articleManager=null;
//	private CategoryManager categoryManager=null;
//	private CompassGps compassGps=null;
//	
//	private CompassSearchHelper compassSearchHelper;
//	
//	public void setCompassGps(CompassGps compassGps) {
//		this.compassGps = compassGps;
//	}
//	
//	public void setCompass(Compass compass) {
//		this.compass = compass;
//	}
//
//	public void testIndexUpadte(){
////		compassGps.index();
//	}
//	
//	public void setCategoryManager(CategoryManager categoryManager) {
//		this.categoryManager = categoryManager;
//	}
//
//	public void setCompassSearchHelper(CompassSearchHelper compassSearchHelper) {
//		this.compassSearchHelper = compassSearchHelper;
//	}
//
//	public void testUpdateArticle(){
//		
////		Article article=articleManager.get(new Long(1));
////		log.info("subject==========我的博客");
////		article.setSubject("我的博客");
////		articleManager.save(article);
////		setComplete();
////		
////		Article art=new Article();
////		art.setContent("人肉搜索");
////		art.setSubject("互联网内容开始");
////		art.setCreateTime(new Date());
////		articleManager.save(art);
////		
////		setComplete();
////		
////		articleManager.remove(5l);
//		//setComplete();
//	}
//
//	
//	public void testSearch(){
//		String query="good";
//		  CompassSession session = compass.openSession();
//		   CompassTransaction tx = session.beginTransaction();
//		   CompassHits hits = session.find(query);
//		   for (int i = 0; i < hits.length(); i++) {
//			   logger.info("alis:" + hits.hit(i).resource().getAlias() +" data:"+hits.hit(i).data().toString());
////		    Article article=(Article)hits.data(i);
////		    System.out.println("Title:"+article.getSubject());
////		    System.out.println("type:"+hits.data(i).toString());
//		   }
//		   hits.close();
//		   tx.commit();
//		   session.close();
//	}
//	
//	public void testInsertCategory(){
////		Category category=new Category();
////		category.setCategoryName("good music");
////		categoryManager.save(category);
////		setComplete();
//	}
//	
//	public void testSearch2(){
//		CompassSearchResults results= compassSearchHelper.search(new CompassSearchCommand("good"));
//		for(int i=0;i<results.getHits().length;i++){
//			CompassHit hit=(CompassHit)results.getHits()[i];
//			logger.info("i=" + i + " " + hit.getData().toString());
//		}
//	}
//	
//	public void setArticleManager(ArticleManager articleManager) {
//		this.articleManager = articleManager;
//	}
//	
//}
